<?php
/**
 * $templateCode   模版id    $recNum 接收短信的号码    $smsParam  变量字符串
 * @author wuzhifeng
 *
 */
class ShortMessageAction extends HomeAction
{
    public function _initialize()
    {
        parent::_initialize();
        include(VENDOR_PATH."alidayu/TopSdk.php");
        date_default_timezone_set('Asia/Shanghai');
    }
    public function send_message($templateCode,$recNum,$smsParam=""){
        $c = new TopClient;
        $c->appkey =C('alidayu_app_key');
        $c->secretKey = C('alidayu_app_secret');
        $req = new AlibabaAliqinFcSmsNumSendRequest;
        $req->setSmsType("normal");
        $req->setSmsFreeSignName(衣来品牌);
        $req->setSmsParam($smsParam);
        //{"code":"1234","product":"alidayu","product":"alidayu","product":"alidayu","product":"alidayu"}
        $req->setRecNum($recNum);
        $req->setSmsTemplateCode($templateCode);
        return $c->execute($req);

    }
}
